//Custom Validations
$(function() {
$.validator.addMethod("requiredGroup",
  function(value, element, params) {
    return $(element).parents("fieldset").find(':input:checked').size()>0;
  }, $.format("This field is required."));

$.validator.addMethod("money",
  function(value, element, params) {
    return  this.optional(element) ||  value.match(/^\$?(?:\d+|\d{1,3}(?:,\d{3})*)(?:\.\d{1,2}){0,1}$/);
  }, $.format("Please enter a valid amount."));

$.validator.addMethod("zip",
  function(value, element, params) {
    return this.optional(element) ||  value.match(/^\d{5}$|^\d{5}-\d{4}$/);
  }, $.format("Please enter a valid zip."));

$.validator.addMethod("timestamp",
  function(value, element, params) {
    return this.optional(element) ||  value.match(/^(([1][012])|([0][1-9])):([0-5]\d)(\s{1})([AP]M)$/);
  }, $.format("Please enter a valid zip."));

$.validator.addMethod("date",
  function(value, element, params) {
    return this.optional(element) ||  value.match(/^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d$/);
  }, $.format("Please enter a valid date."));
});